#include <iostream>
#include<vector>
using namespace std;

int main() {
    string s;
    getline(cin, s);
    vector<string> v;
    int left = -1;
    int right = 0;
    while (right < s.size())
    {
        if (s[right] == ' ')
        {
            v.push_back(s.substr(left + 1, right - left - 1));
            left = right;
            right++;
        }
        else right++;
    }
    v.push_back(s.substr(left + 1, right - left - 1));
    string ret;
    for (int i = v.size() - 1;i >= 0;i--)
    {
        ret += v[i];
        if (i != 0) ret += ' ';
    }
    cout << ret;

    return 0;
}